DROP TABLE [dbo].[user_data]
GO
CREATE TABLE [dbo].[user_data] (
[UserId] int NOT NULL ,
[Account] nvarchar(255) NOT NULL ,
[Password] nvarchar(255) NOT NULL ,
[HashKey] nvarchar(255) NOT NULL ,
[AddTime] datetime2(7) NOT NULL 
)


GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'user_data', 
'COLUMN', N'UserId')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'用户ID'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'user_data'
, @level2type = 'COLUMN', @level2name = N'UserId'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'用户ID'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'user_data'
, @level2type = 'COLUMN', @level2name = N'UserId'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'user_data', 
'COLUMN', N'Account')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'用户账号'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'user_data'
, @level2type = 'COLUMN', @level2name = N'Account'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'用户账号'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'user_data'
, @level2type = 'COLUMN', @level2name = N'Account'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'user_data', 
'COLUMN', N'Password')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'密码'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'user_data'
, @level2type = 'COLUMN', @level2name = N'Password'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'密码'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'user_data'
, @level2type = 'COLUMN', @level2name = N'Password'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'user_data', 
'COLUMN', N'HashKey')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'HashKey'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'user_data'
, @level2type = 'COLUMN', @level2name = N'HashKey'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'HashKey'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'user_data'
, @level2type = 'COLUMN', @level2name = N'HashKey'
GO

-- ----------------------------
-- Indexes structure for table user_data
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table user_data
-- ----------------------------
ALTER TABLE [dbo].[user_data] ADD PRIMARY KEY ([UserId])
GO
